//
//  SmallView.m
//  Run
//
//  Created by 男哥呵呵 on 16/4/6.
//  Copyright © 2016年 BetaTheta. All rights reserved.
//

#import "SmallView.h"

@implementation SmallView

- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    return self;

}

- (void)createView {
    // 时间
    self.timeNum = [[UILabel alloc] initWithFrame:CGRectMake(10, 20, self.bounds.size.width / 2 - 20, self.bounds.size.height / 2)];
    self.timeNum.textAlignment = NSTextAlignmentCenter;
    self.timeNum.text = @"--";
    self.timeNum.font = [UIFont boldSystemFontOfSize:30];
    
    self.time = [[UILabel alloc] initWithFrame:CGRectMake(self.timeNum.frame.origin.x, self.timeNum.frame.size.height + self.timeNum.frame.origin.y, self.timeNum.frame.size.width, 20)];
    self.time.text = @"时长";
    self.time.textAlignment = NSTextAlignmentCenter;
    self.time.font = [UIFont systemFontOfSize:16];
    self.time.textColor = [UIColor colorWithWhite:0.702 alpha:1.000];
    
    [self addSubview:self.timeNum];
    [self addSubview:self.time];
    
    // 距离
    self.distanceNum = [[UILabel alloc] initWithFrame:CGRectMake(self.bounds.size.width / 2 + 10, self.timeNum.frame.origin.y, self.timeNum.frame.size.width, self.timeNum.frame.size.height)];
    self.distanceNum.textAlignment = NSTextAlignmentCenter;
    self.distanceNum.text = @"--";
    self.distanceNum.font = [UIFont boldSystemFontOfSize:30];
    
    self.distance = [[UILabel alloc] initWithFrame:CGRectMake(self.distanceNum.frame.origin.x, self.distanceNum.frame.size.height + self.distanceNum.frame.origin.y, self.distanceNum.frame.size.width, self.time.frame.size.height)];
    self.distance.text = @"距离(公里)";
    self.distance.textAlignment = NSTextAlignmentCenter;
    self.distance.font = [UIFont systemFontOfSize:16];
    self.distance.textColor = [UIColor colorWithWhite:0.702 alpha:1.000];
    
    [self addSubview:self.distanceNum];
    [self addSubview:self.distance];
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
